<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //万物皆对象
   var a
    a()
    var a = function (){
      console.log('123');
    }
    
  class Person {
    constructor(name,age){
      this.name = name
      this.age = age
    }
    eat(n){
      console.log(n);//方法
    }
    sleep(){
      console.log('睡100000小时');
    }
    study(){
      console.log('1秒');
    }
  }
    var  p1 =new Person('wang',60)
    console.log(p1.name);
    console.log(p1.age);
    p1.eat('喜欢睡100小时')
    p1.sleep()
    p1.study()
   
  </script>
</body>
